
package com.cbwl.eoas.cms.model.eoas;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;


/**
 * 
 * <p>[描述信息：app消息信息DTO]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年11月3日 下午2:54:07
 */
public class AppMessageInfoDTO extends CommonBean {

	
	private static final long serialVersionUID = -5739366632986520460L;
	private java.lang.Long id;
	@Length(max=5)
	private java.lang.String amiType;
	@Length(max=216)
	private java.lang.String amiTitle;
	@Length(max=512)
	private java.lang.String amiAbstarct;
	@Length(max=5)
	private java.lang.String amiStatus;
	@Length(max=65535)
	private java.lang.String amiContent;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	
	
	private String amiTypeName;
	
	private String amiStatusName;
	
	private String datemin;
	
	private String datemax;
	
	
	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setAmiType(java.lang.String value) {
		this.amiType = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.amiTypeName = redisValue;
			}
		}
	}
	
	public java.lang.String getAmiType() {
		return this.amiType;
	}
	
	
	public String getAmiTypeName() {
		return amiTypeName;
	}

	
	public void setAmiTypeName(String amiTypeName) {
		this.amiTypeName = amiTypeName;
	}

	public void setAmiTitle(java.lang.String value) {
		this.amiTitle = value;
	}
	
	public java.lang.String getAmiTitle() {
		return this.amiTitle;
	}
	
	public void setAmiAbstarct(java.lang.String value) {
		this.amiAbstarct = value;
	}
	
	public java.lang.String getAmiAbstarct() {
		return this.amiAbstarct;
	}
	
	public void setAmiStatus(java.lang.String value) {
		this.amiStatus = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.amiStatusName = redisValue;
			}
		}
		
		
	}
	
	public java.lang.String getAmiStatus() {
		return this.amiStatus;
	}
	
	public void setAmiContent(java.lang.String value) {
		this.amiContent = value;
	}
	
	public java.lang.String getAmiContent() {
		return this.amiContent;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	
	public String getAmiStatusName() {
		return amiStatusName;
	}

	
	public void setAmiStatusName(String amiStatusName) {
		this.amiStatusName = amiStatusName;
	}

	
	
	
	
	public String getDatemin() {
		return datemin;
	}

	
	public void setDatemin(String datemin) {
		this.datemin = datemin;
	}

	
	public String getDatemax() {
		return datemax;
	}

	
	public void setDatemax(String datemax) {
		this.datemax = datemax;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("AmiType",getAmiType())
			.append("AmiTitle",getAmiTitle())
			.append("AmiAbstarct",getAmiAbstarct())
			.append("AmiStatus",getAmiStatus())
			.append("AmiContent",getAmiContent())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof AppMessageInfoDTO == false) {return false;}
		if(this == obj){return true;}
		AppMessageInfoDTO other = (AppMessageInfoDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

